import request from '@/utils/request'

// 获取设备列表
export function getList(data) {
  return request({
    url: '/assess/deviceInfo/selectAllAndParam',
    method: 'post',
    data
  })
}

// 添加设备
export function addDevice(data) {
  return request({
    url: '/assess/deviceInfo/insert',
    method: 'post',
    data
  })
}

// 修改设备
export function updateDevice(data) {
  return request({
    url: '/assess/deviceInfo/update',
    method: 'post',
    data
  })
}

// 删除设备
export function deleteDevice(data) {
  return request({
    url: '/assess/deviceInfo/delete',
    method: 'post',
    data
  })
}

// 连接设备
export function linkDevice(data) {
  return request({
    url: '/assess/deviceInfo/testEquipment',
    method: 'post',
    data
  })
}

// 断开设备
export function disconnectDevice(data) {
  return request({
    url: '/assess/deviceInfo/disconnectByIds',
    method: 'post',
    data
  })
}

// 查询设备及其对应参数
export function getAdviceAndParams(data) {
  return request({
    url: '/assess/deviceInfo/selectAllAndParam',
    method: 'post',
    data
  })
}

// 获取设备参数
export function getParams(data) {
  return request({
    url: '/assess/spglCollectArgument/selectList',
    method: 'post',
    data
  })
}

// 设置设备参数采集状态
export function updateParam(data) {
  return request({
    url: '/assess/spglCollectArgument/updateList',
    method: 'post',
    data
  })
}